package org.ncibi.cytoscape.metscape.network;

import org.ncibi.cytoscape.metscape.data.Attributes;
import org.ncibi.metab.network.attribute.ReactionAttribute;
import org.ncibi.metab.network.edge.MetabolicEdge;
import org.ncibi.metab.network.edge.ReactionEdge;

public class ReactionEdgeTranslator extends AbstractEdgeTranslator
{
    @Override
    protected String getInteraction(MetabolicEdge edge)
    {
        return ReactionEdge.getRid(edge);
    }

    @Override
    protected void addEdgeAttributes(String id, MetabolicEdge edge)
    {
        Attributes.edge.setAttribute(id, ReactionAttribute.PATHWAY.toAttributeName(),
                ReactionEdge.getPathway(edge));
        Attributes.edge.setAttribute(id, ReactionAttribute.REVERSIBLE.toAttributeName(), ReactionEdge
                    .isReversible(edge));
        Attributes.edge.setAttribute(id, ReactionAttribute.RID.toAttributeName(),
                    ReactionEdge.getRid(edge));
        Attributes.edge.setAttribute(id, ReactionAttribute.EQUATION.toAttributeName(), ReactionEdge
                                .getEquation(edge));
        Attributes.edge.setListAttribute(id,
                ReactionAttribute.LOCATIONS.toAttributeName(), ReactionEdge
                            .getLocations(edge));
    }
}
